import { lazy } from 'react'
import { Navigate, RouteObject } from 'react-router-dom'
import Layout from '@/page/layout/layout'

const InputPage = lazy(() => import('@/page/input/input'))
const ButtonPage = lazy(() => import('@/page/button/button'))

export type IRouteObject = RouteObject & {
    name: string;
    children?: IRouteObject[];
}
const routes: IRouteObject[] = [{
    name: '',
    path: '/',
    element: <Navigate to="/component/input-page" />
}, {
    name: 'component',
    path: '/component',
    element: <Layout />,
    children: [{
        name: 'buttonPage',
        path: 'button-page',
        element: <ButtonPage />,
    }, {
        name: 'inputPage',
        path: 'input-page',
        element: <InputPage />,
    }]
}]

export default routes
